home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Clock.cpp
-
- Contains: Source code for the sample "Clock" part
-
- Owned by: Richard Rodseth
-
- Copyright: © 1993 - 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <3> 12/13/96 JP 1607652: Disabled debugging code
- <2> 5/24/96 jpa 1246074: SOM_CATCH --> SOM_TRY
- To Do:
-
- In Progress:
-
- */
-
- #define SOM_Module_clock_Source
- #define VARIABLE_MACROS
- #ifndef _ALTPOINT_
- #include "AltPoint.h" // Use C++ savvy ODPoint and ODRect
- #endif
-
- #include <Clock.xih>
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- #ifndef _CLOCKDEF_
- #include "ClockDef.h"
- #endif
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
-
- #ifndef _SIHELPER_
- #include "SIHelper.h"
- #endif
-
- #ifndef SOM_Module_OpenDoc_Foci_defined
- #include <Foci.xh>
- #endif
-
- #ifndef _USERSRCM_
- #include "UseRsrcM.h"
- #endif
-
- #ifndef SOM_ODFocusSet_xh
- #include <FocusSet.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdTypes_defined
- #include <StdTypes.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StdDefs_defined
- #include <StdDefs.xh>
- #endif
-
- #ifndef SOM_ODDraft_xh
- #include <Draft.xh>
- #endif
-
- #ifndef SOM_ODDocument_xh
- #include <Document.xh>
- #endif
-
- #ifndef SOM_ODContainer_xh
- #include <ODCtr.xh>
- #endif
-
- #ifndef SOM_ODStorageUnit_xh
- #include <StorageU.xh>
- #endif
-
- #ifndef SOM_ODStorageUnitView_xh
- #include <SUView.xh>
- #endif
-
- #ifndef SOM_ODStorageUnitCursor_xh
- #include <SUCursor.xh>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef SOM_ODWindowState_xh
- #include <WinStat.xh>
- #endif
-
- #ifndef SOM_ODFrame_xh
- #include <Frame.xh>
- #endif
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
- #ifndef SOM_ODFrameFacetIterator_xh
- #include <FrFaItr.xh>
- #endif
-
- #ifndef SOM_ODExtension_xh
- #include <Extensn.xh>
- #endif
-
- #ifndef _ORDCOLL_
- #include "OrdColl.h"
- #endif
-
- #ifndef SOM_ODDispatcher_xh
- #include <Disptch.xh>
- #endif
-
- #ifndef _ODUTILS_
- #include <ODUtils.h>
- #endif
-
- #ifndef SOM_ODMenuBar_xh
- #include <MenuBar.xh>
- #endif
-
- #ifndef SOM_Module_OpenDoc_Commands_defined
- #include <CmdDefs.xh>
- #endif
-
- #ifndef _ITEXT_
- #include <IText.h>
- #endif
-
- #ifndef _ISOSTRING_
- #include "ISOStr.h"
- #endif
-
- #ifndef SOM_ODMessageInterface_xh
- #include <MssgIntf.xh>
- #endif
-
- #ifndef _AEOBJECTS_
- #include "AEObjects.h"
- #endif
-
- #ifndef _FOCUSLIB_
- #include "FocusLib.h"
- #endif
-
- #ifndef SOM_ODArbitrator_xh
- #include <Arbitrat.xh>
- #endif
-
- #ifndef SOM_ODWindow_xh
- #include <Window.xh>
- #endif
-
- #ifndef SOM_ODShape_xh
- #include <Shape.xh>
- #endif
-
- #ifndef SOM_ODTransform_xh
- #include <Trnsform.xh>
- #endif
-
- #ifndef _EXCEPT_
- #include "Except.h"
- #endif
-
- #ifndef __MENUS__
- #include <Menus.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- #ifndef __TOOLUTILS__
- #include <ToolUtils.h>
- #endif
-
- #ifndef __FONTS__
- #include <Fonts.h>
- #endif
-
- #ifndef __SCRIPT__
- #include <Script.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __DIALOGS__
- #include "Dialogs.h"
- #endif
-
- #ifndef __TEXTEDIT__
- #include <TextEdit.h>
- #endif
-
- #ifndef __PACKAGES__
- #include <Packages.h>
- #endif
-
- #ifndef __STRINGS__
- #include <Strings.h>
- #endif
-
- #ifndef __FP__
- #include <Fp.h>
- #endif
-
- #include <string.h>
-
- #ifndef _ODDEBUG_
- #include "ODDebug.h"
- #endif
-
- #ifndef _STDTYPIO_
- #include "StdTypIO.h"
- #endif
-
- #ifndef _INFOUTIL_
- #include <InfoUtil.h>
- #endif
-
- #ifndef _WINUTILS_
- #include "WinUtils.h"
- #endif
-
- #ifndef _ITEXT_
- #include <IText.h>
- #endif
-
- #ifndef _PASCLSTR_
- #include "PasclStr.h"
- #endif
-
- #ifndef _STORUTIL_
- #include <StorUtil.h>
- #endif
-
- #ifndef SOM_Module_OpenDoc_StandardExtensions_defined
- #include <StdExts.xh>
- #endif
-
- #ifndef _CLOCKFRM_
- #include "ClockFrm.h"
- #endif
-
- #ifndef _CLOCKGBL_
- #include "ClockGbl.h"
- #endif
-
- #ifndef _CLOCKPRT_
- #include "ClockPrt.h"
- #endif
-
- #ifndef SOM_ClockSI_xh
- #include <ClockSI.xh>
- #endif
-
- #pragma segment Clock
-
- #define ODDebugLayers 0 // Set to 1 for printfs of suspend/resume and activate events
-
-
- //=========================================================================
- // SOM methods for Clock
- //=========================================================================
-
- //-------------------------------------------------------------------------
- // Constructor/Destructor
- //-------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK AppleTest_ClocksomInit(AppleTest_Clock *somSelf)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","somInit");
-
- AppleTest_Clock_parents_somInit(somSelf);
-
- _fClockPart = kODNULL;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockInitPart(AppleTest_Clock *somSelf, Environment *ev,
- ODStorageUnit* storageUnit, ODPart* partWrapper)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","InitPart");
-
- SOM_TRY
-
- parent_InitPart(somSelf, ev, storageUnit, partWrapper);
-
- ODSession* session = somSelf->GetStorageUnit(ev)->GetSession(ev);
- //$$$$$ Shouldn't OpenDoc pass the session to InitPart?
-
- _fClockPart = new ClockPart;
- _fClockPart->InitClockPart(ev, session, somSelf, partWrapper);
-
- _fClockPart->PrepareStorage(ev, storageUnit);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockInitPartFromStorage(AppleTest_Clock *somSelf, Environment *ev,
- ODStorageUnit* storageUnit, ODPart* partWrapper)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","InitPartFromStorage");
-
- SOM_TRY
-
- parent_InitPartFromStorage(somSelf, ev, storageUnit, partWrapper);
-
- ODSession* session = somSelf->GetStorageUnit(ev)->GetSession(ev);
- //$$$$$ Shouldn't OpenDoc pass the session to InitPartFromStorage?
-
- _fClockPart = new ClockPart;
- _fClockPart->InitClockPart(ev, session, somSelf, partWrapper);
- _fClockPart->Internalize(ev, storageUnit);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClocksomUninit(AppleTest_Clock *somSelf)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","somUninit");
-
- delete _fClockPart;
-
- AppleTest_Clock_parents_somUninit(somSelf);
-
- }
-
-
-
- //-------------------------------------------------------------------------
- // Implementation for DragAndDrop protocol:
- //
- // The Drag and Drop protocol provides facilities for interaction with
- // the user during the dragging of OpenDoc objects. Only part handlers
- // that support embedding of content need to implement the following
- // methods.
- //
- // The Clock Part implements the ::DragEnter, ::DragLeave, and ::Drop
- // methods only to provide the user a bit of feedback while dragging
- // objects.
- //
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock: FulfillPromise
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockFulfillPromise(AppleTest_Clock *somSelf, Environment *ev,
- ODStorageUnitView *promiseSUView)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","FulfillPromise");
-
- SOM_TRY
-
- ODUnused(promiseSUView);
- // Clock Part does not allow embedding of data.
- // This method is not needed.
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: DropCompleted
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDropCompleted(AppleTest_Clock *somSelf, Environment *ev,
- ODPart* destPart,
- ODDropResult dropResult )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DropCompleted");
-
- SOM_TRY
-
- ODUnused(destPart);
- ODUnused(dropResult);
-
- // Clock Part does not allow embedding of data.
- // This method is not needed.
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: DragEnter
- //------------------------------------------------------------------------------
-
-
- SOM_Scope ODDragResult SOMLINK AppleTest_ClockDragEnter(AppleTest_Clock *somSelf, Environment *ev,
- ODDragItemIterator* dragInfo,
- ODFacet* facet,
- ODPoint* where )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DragEnter");
-
- SOM_TRY
-
- ODUnused(dragInfo);
- ODUnused(facet);
- ODUnused(where);
-
- // SetCursor(&_fClockPart->fCrossCursor);
-
- return kODFalse;
-
- SOM_CATCH_ALL_ENDTRY
- return kODFalse;
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: DragWithin
- //------------------------------------------------------------------------------
-
-
- SOM_Scope ODDragResult SOMLINK AppleTest_ClockDragWithin(AppleTest_Clock *somSelf, Environment *ev,
- ODDragItemIterator* dragInfo,
- ODFacet* facet,
- ODPoint* where )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DragWithin");
-
- SOM_TRY
-
- ODUnused(dragInfo);
- ODUnused(facet);
- ODUnused(where);
-
- // Clock Part does not allow embedding of data.
- // This method is not needed.
-
- return kODFalse;
-
- SOM_CATCH_ALL_ENDTRY
- return kODFalse;
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: DragLeave
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDragLeave(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* facet,
- ODPoint* where )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DragLeave");
-
- SOM_TRY
-
- ODUnused(facet);
- ODUnused(where);
-
- // SetCursor(&_fClockPart->fArrowCursor);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: Drop
- //------------------------------------------------------------------------------
-
-
-
- SOM_Scope ODDropResult SOMLINK AppleTest_ClockDrop(AppleTest_Clock *somSelf, Environment *ev,
- ODDragItemIterator* dropInfo,
- ODFacet* facet,
- ODPoint* where )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","Drop");
-
- SOM_TRY
-
- ODUnused(dropInfo);
- ODUnused(facet);
- ODUnused(where);
-
- SysBeep(1);
-
- return kODDropFail;
-
- SOM_CATCH_ALL_ENDTRY
- return kODDropFail;
- }
-
-
- //-------------------------------------------------------------------------
- // Implementation for Frame protocol:
- //
- // The Frame protocol...
- //
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock: DisplayFrameAdded
- //------------------------------------------------------------------------------
-
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDisplayFrameAdded(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DisplayFrameAdded");
-
- SOM_TRY
-
- _fClockPart->DisplayFrameAdded(ev, frame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: DisplayFrameRemoved
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDisplayFrameRemoved(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* oldFrame )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DisplayFrameRemoved");
-
- SOM_TRY
-
- _fClockPart->DisplayFrameRemoved(ev, oldFrame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // Clock: DisplayFrameConnected
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDisplayFrameConnected(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DisplayFrameConnected");
-
- SOM_TRY
-
- _fClockPart->DisplayFrameConnected(ev, frame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // Clock: DisplayFrameClosed
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDisplayFrameClosed(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","DisplayFrameClosed");
-
- SOM_TRY
-
- _fClockPart->DisplayFrameClosed(ev, frame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // Clock: FacetAdded
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockFacetAdded(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* facet)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","FacetAdded");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) facet->GetFrame(ev)->GetPartInfo(ev);
- if (clockFrame)
- clockFrame->FacetAdded(ev, facet);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // Clock: FrameShapeChanged
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockFrameShapeChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","FrameShapeChanged");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) frame->GetPartInfo(ev);
- if (clockFrame)
- clockFrame->FrameShapeChanged(ev);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: ReadPartInfo
- //------------------------------------------------------------------------------
-
-
- SOM_Scope ODInfoType SOMLINK AppleTest_ClockReadPartInfo(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame, ODStorageUnitView* storageUnitView)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","ReadPartInfo");
-
- SOM_TRY
-
- //$$$$$ Shouldn't DisplayFrameConnected get called BEFORE ReadPartInfo?
-
- return _fClockPart->ReadPartInfo(ev, frame, storageUnitView);
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: WritePartInfo
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockWritePartInfo(AppleTest_Clock *somSelf, Environment *ev,
- ODInfoType partInfo,
- ODStorageUnitView* storageUnitView)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","WritePartInfo");
-
- SOM_TRY
-
- /* We don't need to do this if we don't care about coming up active when embedded
- if (partInfo)
- {
- ODBoolean needsActivating = ((ClockFrame*)partInfo)->fNeedsFoci
- || ((ClockFrame*)partInfo)->fHasFoci;
- StorageUnitSetValue(storageUnitView, ev, sizeof(ODBoolean),
- (ODValue)&needsActivating);
- }
- */
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: ClonePartInfo
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockClonePartInfo(AppleTest_Clock *somSelf, Environment *ev,
- ODDraftKey key,
- ODInfoType partInfo,
- ODStorageUnitView* storageUnitView,
- ODFrame* scopeFrame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","ClonePartInfo");
-
- SOM_TRY
-
- /* We don't need to do this if we don't care about coming up active when embedded
- if (partInfo)
- {
- ODBoolean needsActivating = ((ClockFrame*)partInfo)->fNeedsFoci
- || ((ClockFrame*)partInfo)->fHasFoci;
- StorageUnitSetValue(storageUnitView, ev, sizeof(ODBoolean),
- (ODValue)&needsActivating);
- }
- */
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: Open
- //------------------------------------------------------------------------------
-
-
- SOM_Scope ODID SOMLINK AppleTest_ClockOpen(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","Open");
-
- SOM_TRY
-
- ODID windowID;
- ODWindow* window = kODNULL;
-
- if (frame) // Doing a View As Window or Opening a Root Frame
- {
- if (frame->IsRoot(ev))
- {
- windowID = _fClockPart->OpenRootFrame(ev, frame);
- }
- else
- {
- ClockFrame* clockFrame = (ClockFrame*) frame->GetPartInfo(ev);
- if (clockFrame)
- windowID = clockFrame->ViewInWindow(ev);
- }
- }
- else
- {
- windowID = _fClockPart->OpenInitialWindow(ev);
- }
- return windowID;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULLID;
- }
-
-
-
- //-------------------------------------------------------------------------
- // Implementation for Imaging protocol
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock::Draw
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockDraw(AppleTest_Clock *somSelf,
- Environment *ev,
- ODFacet* facet,
- ODShape* invalShape)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","Draw");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) facet->GetFrame(ev)->GetPartInfo(ev);
- if (clockFrame)
- {
- clockFrame->Draw(ev, facet, invalShape);
- }
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //-------------------------------------------------------------------------
- // Implementation for Linking protocol
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock: CreateLink
- //------------------------------------------------------------------------------
-
-
-
- SOM_Scope ODLinkSource* SOMLINK AppleTest_ClockCreateLink(AppleTest_Clock *somSelf, Environment *ev,
- ODByteArray* data)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","CreateLink");
-
- SOM_TRY
-
- ODUnused(data);
-
- return kODNULL;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: LinkUpdated
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockLinkUpdated(AppleTest_Clock *somSelf, Environment *ev,
- ODLink* updatedLink, ODUpdateID change)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","LinkUpdated");
-
- SOM_TRY
-
- ODUnused(updatedLink);
- ODUnused(change);
-
- // does not support linking
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
-
- //-------------------------------------------------------------------------
- // Implementation for Memory Management protocol
- //-------------------------------------------------------------------------
-
- SOM_Scope ODSize SOMLINK AppleTest_ClockPurge(AppleTest_Clock *somSelf, Environment *ev,
- ODSize size )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","Purge");
-
- SOM_TRY
-
- ODStorageUnit* su = somSelf->GetStorageUnit(ev);
- return su -> Purge(ev, size );
-
- SOM_CATCH_ALL_ENDTRY
- return 0;
- }
-
-
- //-------------------------------------------------------------------------
- // Implementation for Storage Management protocol
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock: GetOrderedFrameCollection
- //------------------------------------------------------------------------------
-
-
- extern void GetOrderedFrameCollection(OrderedCollection* aCollection,ODStorageUnit* vfSU);
-
- //------------------------------------------------------------------------------
- // Clock: PutOrderedFrameCollection
- //------------------------------------------------------------------------------
-
-
- extern void PutOrderedFrameCollection(OrderedCollection* aCollection,ODStorageUnit* vfSU);
-
- //------------------------------------------------------------------------------
- // Clock: Externalize
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK AppleTest_ClockExternalize(AppleTest_Clock *somSelf, Environment *ev)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","Externalize");
-
- SOM_TRY
-
- // Give a chance for the parent to Externalize
- parent_Externalize(somSelf, ev);
-
- // Externalize itself
- _fClockPart->Externalize(ev);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
-
- //-------------------------------------------------------------------------
- // Implementation for Part Activation protocol
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock: BeginRelinquishFocus
- //------------------------------------------------------------------------------
-
-
- SOM_Scope ODBoolean SOMLINK AppleTest_ClockBeginRelinquishFocus(AppleTest_Clock *somSelf, Environment *ev,
- ODTypeToken focus,
- ODFrame* currentFrame,
- ODFrame* proposedFrame )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","BeginRelinquishFocus");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) currentFrame->GetPartInfo(ev);
-
- if (clockFrame)
- return clockFrame->BeginRelinquishFocus(ev, focus, proposedFrame);
- else
- return kODTrue;
-
-
- SOM_CATCH_ALL_ENDTRY
- return kODFalse;
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: CommitRelinquishFocus
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockCommitRelinquishFocus(AppleTest_Clock *somSelf, Environment *ev,
- ODTypeToken focus,
- ODFrame* currentFrame,
- ODFrame* proposedFrame )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","CommitRelinquishFocus");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) currentFrame->GetPartInfo(ev);
-
- if (clockFrame)
- clockFrame->CommitRelinquishFocus(ev, focus, proposedFrame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: AbortRelinquishFocus
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockAbortRelinquishFocus(AppleTest_Clock *somSelf, Environment *ev,
- ODTypeToken focus,
- ODFrame* currentFrame,
- ODFrame* proposedFrame )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","AbortRelinquishFocus");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) currentFrame->GetPartInfo(ev);
-
- if (clockFrame)
- clockFrame->AbortRelinquishFocus(ev, focus, proposedFrame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: FocusAcquired
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockFocusAcquired(AppleTest_Clock *somSelf, Environment *ev,
- ODTypeToken focus,
- ODFrame* newOwner )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","FocusAcquired");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) newOwner->GetPartInfo(ev);
-
- if (clockFrame)
- clockFrame->FocusAcquired(ev, focus);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //------------------------------------------------------------------------------
- // Clock: FocusLost
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockFocusLost(AppleTest_Clock *somSelf, Environment *ev,
- ODTypeToken focus,
- ODFrame* oldOwner )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","FocusLost");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) oldOwner->GetPartInfo(ev);
-
- if (clockFrame)
- clockFrame->FocusLost(ev, focus, kODNULL);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- //-------------------------------------------------------------------------
- // Implementation for UI Events protocol
- //-------------------------------------------------------------------------
-
- //------------------------------------------------------------------------------
- // Clock: HandleEvent
- //------------------------------------------------------------------------------
-
-
- SOM_Scope ODBoolean SOMLINK AppleTest_ClockHandleEvent(AppleTest_Clock *somSelf, Environment *ev,
- ODEventData* event,
- ODFrame* frame,
- ODFacet* facet,
- ODEventInfo* eventInfo )
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","HandleEvent");
-
- SOM_TRY
-
- ODBoolean wasHandled = kODFalse;
- ClockFrame* clockFrame = (ClockFrame*) frame->GetPartInfo(ev);
-
- switch ( event -> what ) {
- case kODEvtNull:
- {
- if (clockFrame)
- clockFrame->Idle(ev, event);
- else
- _fClockPart->Idle(ev, event);
- wasHandled = kODTrue;
- break;
- }
-
- case kODEvtMouseDown:
- if (facet == kODNULL)
- {
- wasHandled = kODTrue;
- }
- else
- {
- wasHandled = clockFrame->HandleMouseDown(ev, facet, event);
- }
- break;
-
- case kODEvtMouseUp:
- if (facet == kODNULL)
- {
- wasHandled = kODTrue;
- }
- else
- {
- wasHandled = clockFrame->HandleMouseUp(ev, facet, event);
- }
- break;
-
- case kODEvtMouseDownEmbedded:
- break;
-
- case kODEvtKeyDown:
- case kODEvtAutoKey:
- case kODEvtKeyUp:
- wasHandled = kODFalse;
- break;
-
- case kODEvtActivate:
- wasHandled = true; // actually ignored by dispatcher
- if ((event->modifiers & activeFlag ) != 0)
- clockFrame->ActivatingWindow(ev, facet, event);
- else
- clockFrame->DeactivatingWindow(ev, facet, event);
- break;
- case kODEvtOS:
- _fClockPart->HandleOSEvent(ev, event, frame, facet);
- wasHandled = kODTrue;
- break;
- case kHighLevelEvent:
- break;
- case kODEvtMenu:
- {
- wasHandled = clockFrame->HandleMenuEvent(ev, event);
- break;
- }
- case kODEvtWindow:
- {
- switch (event->message)
- {
- case inGoAway:
- wasHandled = _fClockPart->CloseWindow(ev, frame);
- break;
- case inZoomIn:
- case inZoomOut:
- SysBeep(2);
- wasHandled = kODTrue;
- break;
- default:
- break;
- }
- }
- break;
- case kODEvtMouseEnter:
- clockFrame->MouseEnter(ev, facet, &(eventInfo->where));
- wasHandled = kODTrue;
- break;
- case kODEvtMouseWithin:
- clockFrame->MouseWithin(ev, facet, &(eventInfo->where));
- wasHandled = kODTrue;
- break;
- case kODEvtMouseLeave:
- clockFrame->MouseLeave(ev, facet);
- wasHandled = kODTrue;
- break;
- default:
- break;
- }
-
- return wasHandled;
-
- SOM_CATCH_ALL_ENDTRY
- return kODFalse;
- }
-
- //------------------------------------------------------------------------------
- // Clock: AdjustMenus
- //------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK AppleTest_ClockAdjustMenus(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","AdjustMenus");
-
- SOM_TRY
-
- ClockFrame* clockFrame = (ClockFrame*) frame->GetPartInfo(ev);
-
- clockFrame->AdjustMenus(ev);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
-
-
- //-------------------------------------------------------------------------
- // SemanticInterface
- //-------------------------------------------------------------------------
-
-
- SOM_Scope ODExtension* SOMLINK AppleTest_ClockAcquireExtension(AppleTest_Clock *somSelf, Environment *ev,
- ODType extensionName)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","AcquireExtension");
-
- SOM_TRY
-
- if (!ODISOStrCompare( (ODISOStr)extensionName, kODExtSemanticInterface ))
- return ( (ODExtension*)_fClockPart->AquireSI(ev) );
- else
- return kODNULL;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
-
- SOM_Scope ODBoolean SOMLINK AppleTest_ClockHasExtension(AppleTest_Clock *somSelf, Environment *ev,
- ODType extensionName)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","HasExtension");
-
- SOM_TRY
-
- if (!ODISOStrCompare( (ODISOStr)extensionName, kODExtSemanticInterface ))
- return kODTrue;
- else
- return kODFalse;
-
- SOM_CATCH_ALL_ENDTRY
- return kODFalse;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockReleaseExtension(AppleTest_Clock *somSelf, Environment *ev,
- ODExtension* extension)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("Clock","ReleaseExtension");
-
- SOM_TRY
-
- // the ClockSI extension is destroyed when the ClockPart is destroyed
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- //------------------------------------------------------------------------------
- // Clock: Stubs for unimplemented methods
- //------------------------------------------------------------------------------
-
-
- SOM_Scope void SOMLINK AppleTest_ClockUndoAction(AppleTest_Clock *somSelf, Environment *ev,
- ODActionData* actionState)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockUndoAction");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockRedoAction(AppleTest_Clock *somSelf, Environment *ev,
- ODActionData* actionState)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRedoAction");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockDisposeActionState(AppleTest_Clock *somSelf, Environment *ev,
- ODActionData* actionState,
- ODDoneState doneState)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockDisposeActionState");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockWriteActionState(AppleTest_Clock *somSelf, Environment *ev,
- ODActionData* actionState,
- ODStorageUnitView* storageUnitView)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockWriteActionState");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODActionData SOMLINK AppleTest_ClockReadActionState(AppleTest_Clock *somSelf, Environment *ev,
- ODStorageUnitView* storageUnitView)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockReadActionState");
-
- ODActionData data;
-
- data._maximum = 0;
- data._length = 0;
- data._buffer = kODNULL;
- return data;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockCloneInto(AppleTest_Clock *somSelf, Environment *ev,
- ODDraftKey key,
- ODStorageUnit* storageUnit,
- ODFrame* scopeFrame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockCloneInto");
-
- SOM_TRY
-
- parent_CloneInto(somSelf,ev,key,storageUnit,scopeFrame);
-
- // If one of our properties already exists, this object has been cloned already
-
- if ( storageUnit->Exists(ev, kODPropContents, kODNULL, 0) )
- return;
-
- _fClockPart->CloneInto(ev, key, storageUnit, scopeFrame);
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockExternalizeKinds(AppleTest_Clock *somSelf, Environment *ev,
- ODTypeList* kindset)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockExternalizeKinds");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockChangeKind(AppleTest_Clock *somSelf, Environment *ev,
- ODType kind)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockChangeKind");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClockCanvasUpdated(AppleTest_Clock *somSelf, Environment *ev,
- ODCanvas* canvas)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockCanvasUpdated");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockHighlightChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* facet)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockHighlightChanged");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODULong SOMLINK AppleTest_ClockGetPrintResolution(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockGetPrintResolution");
-
- SOM_TRY
-
- return 0;
-
- SOM_CATCH_ALL_ENDTRY
- return 0;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockRevealLink(AppleTest_Clock *somSelf, Environment *ev,
- ODLinkSource* linkSource)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRevealLink");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockEmbeddedFrameUpdated(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame,
- ODUpdateID change)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockEmbeddedFrameUpdated");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockLinkStatusChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockLinkStatusChanged");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClockFacetRemoved(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* facet)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockFacetRemoved");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockCanvasChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* facet)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockCanvasChanged");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODFrame* SOMLINK AppleTest_ClockRequestEmbeddedFrame(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* containingFrame,
- ODFrame* baseFrame,
- ODShape* frameShape,
- ODPart* embedPart,
- ODTypeToken viewType,
- ODTypeToken presentation,
- ODBoolean isOverlaid)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRequestEmbeddedFrame");
-
- SOM_TRY
-
- ODSetSOMException(ev, kODErrCannotEmbed);
-
- return kODNULL;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockRemoveEmbeddedFrame(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* embeddedFrame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRemoveEmbeddedFrame");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODShape* SOMLINK AppleTest_ClockRequestFrameShape(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* embeddedFrame,
- ODShape* frameShape)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRequestFrameShape");
-
- SOM_TRY
-
- return (frameShape);
-
- SOM_CATCH_ALL_ENDTRY
- return frameShape;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockUsedShapeChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* embeddedFrame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockUsedShapeChanged");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODShape* SOMLINK AppleTest_ClockAdjustBorderShape(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* embeddedFacet,
- ODShape* shape)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockAdjustBorderShape");
-
- SOM_TRY
-
- ODAcquireObject(ev, shape);
- return shape;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClockViewTypeChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockViewTypeChanged");
-
- SOM_TRY
-
- //$$$$$ Delegate to frame method. Clock doesn't yet support other view types
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockPresentationChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockPresentationChanged");
-
- SOM_TRY
-
- //$$$$$ Delegate to frame method.
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockSequenceChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockSequenceChanged");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClockGeometryChanged(AppleTest_Clock *somSelf, Environment *ev,
- ODFacet* facet, ODBoolean clipShapeChanged, ODBoolean externalTransformChanged)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockGeometryChanged");
-
- SOM_TRY
-
- facet->Invalidate(ev, kODNULL, kODNULL); // Would be better to invalidate difference
- //$$$$$ Delegate to frame method
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClockAttachSourceFrame(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame,
- ODFrame* sourceFrame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockAttachSourceFrame");
-
- SOM_TRY
-
-
- SOM_CATCH_ALL_ENDTRY
- }
-
-
- SOM_Scope void SOMLINK AppleTest_ClockRelease(AppleTest_Clock *somSelf, Environment *ev)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRelease");
-
- SOM_TRY
-
- parent_Release(somSelf, ev);
-
- if( _fClockPart )
- _fClockPart->Release(ev);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockReleaseAll(AppleTest_Clock *somSelf, Environment *ev)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockReleaseAll");
-
- SOM_TRY
-
- // PRINT("Clock Release All\n");
-
- if( _fClockPart )
- _fClockPart->ReleaseAll(ev);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockContainingPartPropertiesUpdated(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame,
- ODStorageUnit* propertyUnit)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockContainingPartPropertiesUpdated");
-
- SOM_TRY
-
- AppleTest_Clock_parent_ODPart_ContainingPartPropertiesUpdated(somSelf,ev,frame,propertyUnit);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODStorageUnit* SOMLINK AppleTest_ClockAcquireContainingPartProperties(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockAcquireContainingPartProperties");
-
- SOM_TRY
-
- ODSetSOMException(ev, kODErrCannotEmbed);
-
- return kODNULL;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
- SOM_Scope ODBoolean SOMLINK AppleTest_ClockRevealFrame(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* embeddedFrame,
- ODShape* revealShape)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockRevealFrame");
-
- SOM_TRY
-
- ODSetSOMException(ev, kODErrInvalidFrame);
- return kODFalse;
-
- SOM_CATCH_ALL_ENDTRY
- return kODFalse;
- }
-
- SOM_Scope void SOMLINK AppleTest_ClockEmbeddedFrameSpec(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* embeddedFrame,
- ODObjectSpec* spec)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockEmbeddedFrameSpec");
-
- SOM_TRY
-
- ODSetSOMException(ev, kODErrInvalidFrame);
-
- SOM_CATCH_ALL_ENDTRY
- }
-
- SOM_Scope ODEmbeddedFramesIterator* SOMLINK AppleTest_ClockCreateEmbeddedFramesIterator(AppleTest_Clock *somSelf, Environment *ev,
- ODFrame* frame)
- {
- AppleTest_ClockData *somThis = AppleTest_ClockGetData(somSelf);
- AppleTest_ClockMethodDebug("AppleTest_Clock","AppleTest_ClockCreateEmbeddedFramesIterator");
-
- SOM_TRY
-
- ODSetSOMException(ev, kODErrCannotEmbed);
-
- return kODNULL;
-
- SOM_CATCH_ALL_ENDTRY
- return kODNULL;
- }
-
-